LIBNAME=libuthreads.a 
OBJ=list.o user_threads.o user_mutex.o user_io.o
GCC=gcc -g -Werror
LIB_C=list.c user_threads.c user_mutex.c user_io.c
LIB_H=list.h user_threads.h user_mutex.h user_io.h 
LIB_ALL=$(LIB_C) $(LIB_H) Makefile

try: try.c list.o user_threads.o user_mutex.o
	gcc -Werror -o test $^

test_mutex.c: lib $@
	$(GCC) -o $(basename $@) $@ $(LIBNAME) 

lib: $(OBJ)
	ar rcs $(LIBNAME) $^

*.o: $(LIB_ALL)
	$(GCC) -c $(basename $@).c
